{% extends "base.html" %}
{% load match %}
{% load partial_template %}

{% block additional_title %}
Preporučeni mečevi za danas
{% endblock %}

{% block nav %}
{% partial_template navigation.html selected_tab:"recommended" user:user perms:perms %}
{% endblock %}

{% block content %}
<center>
	<h2>Preporučeni mečevi za {% now "d.m.Y." %}</h2>

	{% if recommended %}
	<table class="recommendedTable">
		<thead>
			<tr>
				<th width="5%"></th>
				<th>Sport</th>			
				<th>Igrači</th>
				<th width="30%">Head2Head</th>
				<th width="10%">Rezultat</th>
			</tr>			
		</thead>
		<tbody>
		{% for rec in recommended %}
			<tr>
				<td>{{ forloop.counter }}.</td>
				<td>
				{% if rec.0.game_type == 1 %}
					Šah
				{% elif rec.0.game_type == 2 %}
					Stoni fudbal
				{% elif rec.0.game_type == 3 %}
					Fudbal
				{% elif rec.0.game_type == 4 %}
					Basket
				{% else %}
				{% endif %}
				</td>
				<td>{{ rec.0|match }}</td>
				<td>
				{% for home_user in rec.0.home.all %}
					{% for away_user in rec.0.away.all %}
						{% if rec.0.game_type == 1 %}
							<a href="/mdcs/head2head/chess/{{ home_user.id }}/{{ away_user.id }}/">
						{% elif rec.0.game_type == 2 %}
							<a href="/mdcs/head2head/table_football/{{ home_user.id }}/{{ away_user.id }}/">
						{% elif rec.0.game_type == 3 %}
							<a href="/mdcs/head2head/football/{{ home_user.id }}/{{ away_user.id }}/">
						{% elif rec.0.game_type == 4 %}
							<a href="/mdcs/head2head/basketball/{{ home_user.id }}/{{ away_user.id }}/">
						{% else %}
							<a href="/mdcs/head2head/">
						{% endif %}
						{{ home_user.user.first_name }} {{ home_user.user.last_name }} vs.
						{{ away_user.user.first_name }} {{ away_user.user.last_name }}
						</a>
						<br/>
					{% endfor %}
				{% endfor %}
				</td>
				{% if rec.0.result %}
				<td>{{ rec.0.result }}</td>
				{% else %}
				<td>Neodigrano</td>
				{% endif %}
			</tr>
		{% endfor %}
		</tbody>
	</table>
	{% else %}
	Za danas nema preporučenih mečeva
	{% endif %}
</center>

<div style="text-align: right; padding-right: 20px; padding-top: 50px">
	<a href="/mdcs/about/recommended/">Nije Vam jasno šta su to preporučeni mečevi?</a>
</div>
{% endblock %}
